package com.yanqu.road.server.manger.rebate;

import com.yanqu.road.entity.rebate.UserRebateInfo;
import com.yanqu.road.logic.bussiness.player.UserRebateBussiness;
import com.yanqu.road.server.TempMgr;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class RebateMgr extends TempMgr {

    private static Map<String, UserRebateInfo> userRebateInfoMap = new ConcurrentHashMap<>();

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return true;
    }


    public static UserRebateInfo getRebateInfo(String platformUserId){
        return userRebateInfoMap.get(platformUserId);
    }

    public boolean save() {
        return true;
    }

    @Override
    public boolean stop() {
        return false;
    }

    @Override
    public boolean reloadData() {
        userRebateInfoMap = UserRebateBussiness.getUserRebateInfoMap();
        return true;
    }
}
